/**
 * Created by 1 on 2016/12/30.
 */
(function(){
    "use strict";
    function Block(blockType){
        this.blockType=blockType;
        this.size=30;
        this.orgainalSize=32;
        this.sprite=window.ResourceManager.getResource("blocks");
    }
    Block.prototype={
        constructor:Block,
        draw:function(context,x,y,blockType,size){
            size=size || this.size;
            context.drawImage(this.sprite,((blockType || this.blockType)-1)*this.orgainalSize,0,this.orgainalSize,this.orgainalSize,
                    size*x,size*y,size,size);//绘制方块
        }
    };
    window.Block=Block;
})();